/**
 * --------------------------------------------------
 * 		Project	:	Rss Reader
 * 		Class	:	SplashActivity
 * 		Called	:		 
 * 		Desc	:	Splash Screen
 * --------------------------------------------------
 */
package com.application.main;
import com.application.screen.WelcomeScreen;
import com.example.sispakmobile.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
/** ============================================================================= **/

/**
 * @author aaz-dhika
 * 
 */
public class SplashActivity extends Activity {
	/* =========================================================================== */		
	private static String TAG = SplashActivity.class.getName();
	private static long SLEEP_TIME = 5;
	/* =========================================================================== */	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.splash_screen);
		
		IntentLauncher launcher = new IntentLauncher();
		launcher.start();
	}
	/* =========================================================================== */		
	private class IntentLauncher extends Thread{
		public void run(){
			try {
				Thread.sleep(SLEEP_TIME*1000);
			} catch (Exception e) {
				// TODO: handle exception
				Log.e(TAG, e.getMessage());
			}            
            // Start main activity
          	Intent intent = new Intent(SplashActivity.this, WelcomeScreen.class);
          	SplashActivity.this.startActivity(intent);
          	SplashActivity.this.finish();
		}		
	}
	/* =========================================================================== */		
}
/** ============================================================================= **/
